package com.dk.service.impl;

import com.dk.mapper.CarTypeMapper;
import com.dk.pojo.CarType;
import com.dk.service.CarTpeyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CarTpeyServiceImpl implements CarTpeyService {
    @Autowired
    private CarTypeMapper carTypeMapper;

    @Override
    public List<CarType> getCarTypeInfo() {
        return carTypeMapper.selectByExample(null);
    }

    @Override
    public void addCarType(CarType ct) {
        carTypeMapper.insertSelective(ct);
    }

    @Override
    public CarType getCarTypeById(Integer tid) {
        return carTypeMapper.selectByPrimaryKey(tid);
    }

    @Override
    public void updateCarType(CarType ct) {
        carTypeMapper.updateByPrimaryKeySelective(ct);
    }

    @Override
    public void deleteCarType(Integer tid) {
        carTypeMapper.deleteByPrimaryKey(tid);
    }
}
